$__AUI_FORM_VALIDATION_SELECTOR: ".#{$aui-ns}-form-validation";

/// use to create a form-validate state
@mixin aui-form-create-form-control-state() {   
    #{$__AUI_FORM_CONTTROL_SELECTOR} {
        &.is-dirty.is-invalid {
            border-color: $aui-brand-danger;
        }
        
        &.is-dirty.is-valid,
        &.is-dirty.is-valid:focus {
            border-color: $aui-brand-success;
        } 
    }
}

@mixin aui-form-mixin-form-validation() {
    @include aui-form-create-form-control-state();
}

/// use to create a .form-control class
@mixin aui-form-create-form-validation($selector: $__AUI_FORM_VALIDATION_SELECTOR) {
    #{$selector} {
       @include aui-form-mixin-form-validation();
    }
}

@mixin aui-form-use-form-validation-selector() {
    #{$__AUI_FORM_VALIDATION_SELECTOR} {
        @content;
    }
}